package com.buka.service;

import com.buka.entity.Pay;
import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

@LocalTCC
public interface PayTccAction {

    @TwoPhaseBusinessAction(name = "payTccAction", commitMethod = "confirm", rollbackMethod = "cancel")
    boolean prepareCreatePayment(BusinessActionContext ctx,
                                 @BusinessActionContextParameter("pay") Pay pay);

    boolean confirm(BusinessActionContext ctx);

    boolean cancel(BusinessActionContext ctx);
}